<?php
/**
 * gcFramework
 *
 * Development framework for PHP 5 or newer
 *
 * @package		gcFramework
 * @author		Adam Martin
 * @copyright	Copyright (c) 2006
 * @license		http://www.gcFramework.com/web/license.html
 * @link		http://www.gcFramework.com
 * @since		Version 1.0
 */
 
 //instantiate class
 $html = new html;
 
 //@todo - like this - make sure all class variables are public
 
 class html{
 	
 	public $header = ''; 
 	
 	public function html(){
 			
 	}
 	
 	public function head($title='', $loadjs=false){
 		global $gcyaml;
 		$header=$gcyaml->loadconfig("seo");
 		echo '<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">'."\n";
 		echo '<html xmlns="http://www.w3.org/1999/xhtml">'."\n";
 		echo '<head>'."\n";
 		if(!$title || $title=='' || $title==null){
 			self::title($header["title"]);	
 		} else {
 			//echo $title;
 			self::title($title);	
 		}
 		echo ' <meta http-equiv="Content-Type" content="text/html; charset=utf-8" />'."\n";
 		echo ' <meta name="revisit-after" content="1 Week" />'."\n";
 		if($loadjs){
 			//load scriptaculous and prototype
 			echo '<script src="'.LIVESITE."/".FRAMEWORK.'/scripts/prototype/prototype-'.PROTOTYPE.'.js" type="text/javascript"></script>'."\n";
			echo '<script src="'.LIVESITE."/".FRAMEWORK.'/scripts/scriptaculous'.SCRIPTACULOUS.'.js" type="text/javascript"></script>'."\n";	
 		}
 		self::generator();
 		self::keywords($header["keywords"]);
 		self::desc($header["description"]);
 		self::author($header["author"]);
 		
 	}
 	
 	public function keywords($keywords=''){
 		if(!$keywords || $keywords=='' || $keywords==null){
 			displayError('ERROR_HTML_NOKEYWORDS');	
 		}
 		echo ' <meta name="keywords" content="'.$keywords.'" />'."\n";	
 	}
 	
 	public function desc($description=''){
 		if(!$description || $description=='' || $description==null){
 			displayError('ERROR_HTML_NODESCRIPTION');	
 		}
 		echo ' <meta name="description" content="'.$description.'" />'."\n";	
 	}
 	
 	public function refresh($seconds='3600'){
 		echo ' <meta name="refresh" content="'.$seconds.'" />'."\n";	
 	}
 	
 	public function rating($rating){
 		echo ' <meta name="rating" content="'.$rating.'" />'."\n";	
 	}
 	
 	public function author($name=''){
 		echo ' <meta name="author" content="'.$name.'" />'."\n";	
 	}
 	
 	public function copyright($coyright=''){
 		echo ' <meta name="coyright" content="'.$coyright.'" />'."\n";	
 	}
 	
 	public function generator($generator='gcFramework'){
 		echo ' <meta name="generator" content="'.$generator.'" />'."\n";	
 	}
 	
 	public function comment($comment=''){
 		echo '<!--'.$comment.' -->';	
 	}
 	
 	public function title($title=''){
 		if(!$title || $title=='' || $title==null){
 			displayError(ERROR_HTML_NOTITLE);	
 		}
 		echo ' <title>'.$title.'</title>'."\n";	
 	}
 	
 	public function heading($data='', $h='1'){
 		echo '<h'.$h.'>'.$data.'</h'.$h.'>';	
 	}
 	
 	public function nbs($num='1'){
 		echo str_repeat('&nbsp;', $num);	
 	}
 	
 	public function br($num='1'){
 		echo str_repeat('<br />', $num);	
 	}
 	
 }
?>
